package per.jdz.retryer.predicate;

/**
 * 发生异常处理
 */
public class ThrowsPredicate<T> implements IPredicate<T> {

    public final Class<? extends Throwable> throwable;

    public ThrowsPredicate(Class<? extends Throwable> throwable) {
        this.throwable = throwable;
    }

    @Override
    public boolean apply(T input) {
        return throwable.equals(input.getClass());
    }
    
}
